<%-- 
    Document   : Activity_Info
    Created on : 2020-6-3, 17:48:23
    Author     : PseudoDisciple
--%>

<%@page import="com.qdu.entity.Users"%>
<%@page import="com.qdu.entity.PublicActivity"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %>

<%@page import="java.util.List"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link rel="stylesheet" href="css/bootstrap.min.css"/>
        <link rel="stylesheet" href="css/style.css"/>
        <script src="js/jquery-3.4.1.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="js/script.js" charset="UTF-8"></script>

        <link rel="stylesheet" type="text/css" href="css/default.css">
        <link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Roboto:300,700">
        <link rel="stylesheet" href="css/style.min.css">
        <!--<link rel="stylesheet" href="css/bootstrap.min.css"/>-->
        <link rel="stylesheet" href="css/mystyle.css"/>
        <script src="js/jquery-3.4.1.js"></script>	
        <!--<script src="js/bootstrap.min.js"> </script>-->
        <!-- 最新版本的 Bootstrap 核心 CSS 文件 -->
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
        <!-- 最新的 Bootstrap 核心 JavaScript 文件 -->
        <script src="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
        
                    <script type="text/javascript" src="ueditor/ueditor.config.js"></script>  
<script type="text/javascript" src="ueditor/ueditor.all.js"></script>  
<link rel="stylesheet" href="ueditor/themes/default/css/ueditor.css"> 
<script type="text/javascript" charset="utf-8"  
    src="ueditor/lang/zh-cn/zh-cn.js"></script> 
<script type="text/javascript">  
        UE.getEditor("Ccom");  
  </script>   
        
        
        <title>已发布的活动</title>

        <style type="text/css">
            #div1{text-align: center;width: 500px;height: 40px; padding-left: 50px;padding-right: 5px;}
            .div2{display: inline-block;padding-left: 5px;padding-right: 5px;border: 1px solid;margin-left: 5px;margin-right: 5px;}
        </style>
    </head>
    <body>


        <!--------------------------上部菜单栏------------------------------>    
        <div style="position: relative;left: 880px;" >
            <nav class="class="navbar navbar-default navbar-fixed-top"" >
                 <div class="container"  >
                    <!-- Brand and toggle get grouped for better mobile display -->
                    <div class="navbar-header">
                        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
                            <span class="sr-only">Toggle navigation</span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                            <span class="icon-bar"></span>
                        </button>
                        <a class="navbar-brand" href="login.html" style=" font-family:黑体" >注销</a>
                    </div>

                    <!-- Collect the nav links, forms, and other content for toggling -->
                    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1" >
                        <ul class="nav navbar-nav">

                            <li><a href="AllActivity.jsp" style=" font-family:黑体">所有活动</a></li>
                            <li class="dropdown">
                                <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false" style="font-family:'黑体'">其他选项 <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    <li><a href="#">Action</a></li>
                                    <li><a href="#">Another action</a></li>
                                    <li><a href="#">Something else here</a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="#">Separated link</a></li>
                                    <li role="separator" class="divider"></li>
                                    <li><a href="#">退出登陆</a></li>
                                </ul>
                            </li>
                        </ul>
                        <form class="navbar-form navbar-left" action="gabns">
                            <div class="form-group">
                                <input type="text" class="form-control" placeholder="请输入关键字">
                            </div>
                            <button type="submit" class="btn btn-default">搜索</button>
                        </form>
                        
                    </div><!-- /.navbar-collapse -->
                </div><!-- /.container-fluid -->
            </nav>    
        </div>  


        <!---------------------------------标头---------------------------->
        <div class="page-header">
            <img src="img/19081068d0dc8bcc4447246548cab615.png" style="float:left; position:absolute;top:65px">
            <h1 class="head1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                公益网 <small class="head2"><i>阳光、雨露、雪中炭；真爱、慈善、人间情。</i></small></h1>
        </div>




        <!---------------------------------内容---------------------------->



        <%
            PublicActivity pa = (PublicActivity) request.getAttribute("pa");
        %>
        <%
        Users user = (Users) session.getAttribute("users");
        %>

  
                
                        <sql:setDataSource  driver="com.microsoft.sqlserver.jdbc.SQLServerDriver" 

                            url="jdbc:sqlserver://localhost:1433;databaseName=PA"
                            user="sa"
                            password="sa" 
                            var="ds" 
                            scope="session" />

        <sql:query dataSource="${ds}" var="rs" scope="page">
            select * from Comment where Pno=<%=pa.getPno()%>
        </sql:query>

        <div >
            <div class="content">

                <div  class="leftDiv">
                    <p>活动主题：<%=pa.getPtopic()%></p>
                    <br>
                    <br>
                    <p>活动编号：<%=pa.getPno()%></p>
                    <p>活动类型：<%=pa.getPtype()%></p>
                    <p>活动人数：<%=pa.getPnum()%></p>
                    <p>活动开始时间：<%=pa.getPbegin()%></p>
                    <p>活动结束时间：<%=pa.getPend()%></p>
                    <p>活动报名开始时间：<%=pa.getPbstart()%></p>
                    <p>活动报名截止时间：<%=pa.getPbend()%></p>
                    <p>活动金额：<%=pa.getPmoney()%></p>
                    <p>活动地点：<%=pa.getPlocal()%></p>
                    <p>活动备注：<%=pa.getPps()%></p>
                    <p>活动标签：<%=pa.getPtag()%></p>
                    <p>活动情况：<%=pa.getPsit()%></p>
                    <p>活动介绍：<%=pa.getPintro()%></p>

                    <br>
                </div>

                <c:forEach items="${rs.rows}" var="row">
                    <table class="table table-bordered table-hover table-striped text-center" >
                        <tr>
                            <td>用户编号：</td>
                            <td>${row.Uno}</td>
                        </tr>
                        <tr>
                            <td>用户名：</td>
                            <td>${row.Uname}</td>
                        </tr>               
                        <tr>
                            <td>评论：</td>
                            <td>${row.Ccom}</td>
                        </tr>

                    </table>
                </c:forEach>  


                <div class="modal fade" id="sub_modal" tabindex="-1">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-body">
                                <form class="form-inline" id="join_form"> 
                                    <label for="Uno">用户编号：</label>
                                    <input id="Uno" type="text" name="Uno" value="<%=user.getUno()%>" readonly  class="form-control">
                                    <label for="Uname">用户名：</label>
                                    <input id="Uname" type="text" name="Uname" value="<%=user.getUname()%>" readonly  class="form-control">
                                    <label for="Pnum">参加人数：</label>
                                    <input id="Pnum" type="text" name="Pnum" value="<%=pa.getPnum()%>" readonly  class="form-control">
                                    <label for="Pno">活动编号：</label>
                                    <input id="Pno" type="text" name="Pno" value="<%=pa.getPno()%>" readonly  class="form-control">
                                </form>
                            </div>



                        </div>
                    </div>

                </div>
                <button id="btn_join" class="btn btn-info " >报名</button>
                &nbsp;&nbsp;
                <button id="btn_exit" class="btn btn-info " >退出报名</button>
                &nbsp;&nbsp;
                <button id="btn_checkjoiners" onclick="window.location.href='gubps?Pno=<%=pa.getPno()%>'" class="btn btn-info " >查看报名者</button>
                <hr  class="clear">
                <form class="form-inline" id="add_pinglun"> 
                    <label for="Uno" style="display:none;">用户编号：</label>
                    <input id="Uno" type="text" name="Uno" value="<%=user.getUno()%>" readonly  class="form-control" style="display:none;">
                    <label for="Uname" style="display:none;">用户编号：</label>
                    <input id="Uname" type="text" name="Uname" value="<%=user.getUname()%>" readonly  class="form-control" style="display:none;">
                    <label for="Ccom">评论：</label>
                    <textarea id="Ccom" name="Ccom" style="width: 520px; height: 200px;"></textarea>
                    <label for="Pno" style="display:none;">活动编号：</label>
                    <input id="Pno" type="text" name="Pno" value="<%=pa.getPno()%>" readonly  class="form-control" style="display:none;">
                    <button id="btn_pinglun" class="btn btn-info " >评论</button>
                </form>

                </body>
                </html>
